class TradeCarModel {
  List<TradeShopList>? tradeShopList;
  CartShopPrice? tradePrice;

  TradeCarModel({this.tradeShopList, this.tradePrice});

  TradeCarModel.fromJson(Map<String, dynamic> json) {
    if (json['tradeShopList'] != null) {
      tradeShopList = <TradeShopList>[];
      json['tradeShopList'].forEach((v) {
        tradeShopList!.add(TradeShopList.fromJson(v));
      });
    }
    tradePrice = json['tradePrice'] != null
        ? CartShopPrice.fromJson(json['tradePrice'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    if (tradeShopList != null) {
      data['tradeShopList'] =
          tradeShopList!.map((v) => v.toJson()).toList();
    }
    if (tradePrice != null) {
      data['tradePrice'] = tradePrice!.toJson();
    }
    return data;
  }
}

class TradeShopList {
  List<TradeSkuList>? tradeSkuList;
  bool? checked;
  int? goodsNum;
  int? shopId;
  String? shopName;
  bool? ownStatus;
  String? logoUrl;
  CartShopPrice? cartShopPrice;

  TradeShopList(
      {this.tradeSkuList,
        this.checked,
        this.goodsNum,
        this.shopId,
        this.shopName,
        this.ownStatus,
        this.logoUrl,
        this.cartShopPrice});

  TradeShopList.fromJson(Map<String, dynamic> json) {
    if (json['tradeSkuList'] != null) {
      tradeSkuList = <TradeSkuList>[];
      json['tradeSkuList'].forEach((v) {
        tradeSkuList!.add(TradeSkuList.fromJson(v));
      });
    }
    checked = json['checked'];
    goodsNum = json['goodsNum'];
    shopId = json['shopId'];
    shopName = json['shopName'];
    ownStatus = json['ownStatus'];
    logoUrl = json['logoUrl'];
    cartShopPrice = json['cartShopPrice'] != null
        ? CartShopPrice.fromJson(json['cartShopPrice'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    if (tradeSkuList != null) {
      data['tradeSkuList'] = tradeSkuList!.map((v) => v.toJson()).toList();
    }
    data['checked'] = checked;
    data['goodsNum'] = goodsNum;
    data['shopId'] = shopId;
    data['shopName'] = shopName;
    data['ownStatus'] = ownStatus;
    data['logoUrl'] = logoUrl;
    if (cartShopPrice != null) {
      data['cartShopPrice'] = cartShopPrice!.toJson();
    }
    return data;
  }
}

class TradeSkuList {
  TradeGoodsSku? tradeGoodsSku;
  int? num;
  int? purchasePrice;
  int? subTotal;
  bool? checked;
  bool? invalid;
  bool? isFreeFreight;
  String? errorMessage;

  TradeSkuList(
      {this.tradeGoodsSku,
        this.num,
        this.purchasePrice,
        this.subTotal,
        this.checked,
        this.invalid,
        this.isFreeFreight,
        this.errorMessage});

  TradeSkuList.fromJson(Map<String, dynamic> json) {
    tradeGoodsSku = json['tradeGoodsSku'] != null
        ? new TradeGoodsSku.fromJson(json['tradeGoodsSku'])
        : null;
    num = json['num'];
    purchasePrice = json['purchasePrice'];
    subTotal = json['subTotal'];
    checked = json['checked'];
    invalid = json['invalid'];
    isFreeFreight = json['isFreeFreight'];
    errorMessage = json['errorMessage'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.tradeGoodsSku != null) {
      data['tradeGoodsSku'] = this.tradeGoodsSku!.toJson();
    }
    data['num'] = this.num;
    data['purchasePrice'] = this.purchasePrice;
    data['subTotal'] = this.subTotal;
    data['checked'] = this.checked;
    data['invalid'] = this.invalid;
    data['isFreeFreight'] = this.isFreeFreight;
    data['errorMessage'] = this.errorMessage;
    return data;
  }
}

class TradeGoodsSku {
  int? id;
  int? spuId;
  String? skuName;
  int? salePrice;
  String? imgUrl;
  String? specValues;

  TradeGoodsSku(
      {this.id,
        this.spuId,
        this.skuName,
        this.salePrice,
        this.imgUrl,
        this.specValues});

  TradeGoodsSku.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    spuId = json['spuId'];
    skuName = json['skuName'];
    salePrice = json['salePrice'];
    imgUrl = json['imgUrl'];
    specValues = json['specValues'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['spuId'] = this.spuId;
    data['skuName'] = this.skuName;
    data['salePrice'] = this.salePrice;
    data['imgUrl'] = this.imgUrl;
    data['specValues'] = this.specValues;
    return data;
  }
}

class CartShopPrice {
  int? goodsPrice;
  int? freightPrice;
  int? shopDiscountPrice;
  int? couponPrice;
  int? settlementPrice;
  int? billPrice;

  CartShopPrice(
      {this.goodsPrice,
        this.freightPrice,
        this.shopDiscountPrice,
        this.couponPrice,
        this.settlementPrice,
        this.billPrice});

  CartShopPrice.fromJson(Map<String, dynamic> json) {
    goodsPrice = json['goodsPrice'];
    freightPrice = json['freightPrice'];
    shopDiscountPrice = json['shopDiscountPrice'];
    couponPrice = json['couponPrice'];
    settlementPrice = json['settlementPrice'];
    billPrice = json['billPrice'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['goodsPrice'] = this.goodsPrice;
    data['freightPrice'] = this.freightPrice;
    data['shopDiscountPrice'] = this.shopDiscountPrice;
    data['couponPrice'] = this.couponPrice;
    data['settlementPrice'] = this.settlementPrice;
    data['billPrice'] = this.billPrice;
    return data;
  }
}
